package com.hdaccp.cloud.service;

import com.hdaccp.cloud.bean.Users;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;
@Component
public class UsersServiceClientFactory implements FallbackFactory<UsersServiceClient> {
    @Override
    public UsersServiceClient create(Throwable throwable) {
        return new UsersServiceClient() {
            @Override
            public Users getUsers(int id) {
                return new Users(-100,"默认用户","河北");
            }

            @Override
            public List<Users> query() {
                return null;
            }
        };
    }
}
